//
//  CellOfFirst.m
//  ProjectA_ManualGuest
//
//  Created by dingcong on 16/6/24.
//  Copyright © 2016年 丁聪. All rights reserved.
//

#import "CellOfFirst.h"
#import "Masonry.h"
#import "PrefixHeader.pch"
#import "UIImageView+WebCache.h"
@interface CellOfFirst ()




@property(nonatomic, retain)UILabel *labelOfFooter;

@end


@implementation CellOfFirst


- (void)dealloc{
    [_model release];
    [_imageOfBig release];
    [_labelOfFooter release];
    [super dealloc];
    
}




- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame])
    {
        [self creat];
    }
    return self;
    
    
    
}


- (void)creat{
    
    self.imageOfBig = [[UIImageView alloc]init];
    
//    self.imageOfBig.backgroundColor = [UIColor greenColor];
    
    [self.contentView addSubview:self.imageOfBig];
    
    [self.imageOfBig mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView.mas_top).offset(0);
        make.leading.equalTo(self.contentView.mas_leading).offset(0);
        make.height.equalTo(self.contentView.mas_height).offset(- 100);
        make.width.equalTo(self.contentView.mas_width);
    }];
    
    [self.imageOfBig release];
    
    self.labelOfFooter = [[UILabel alloc]init];
//    self.labelOfFooter.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.labelOfFooter];
    
    self.labelOfFooter.numberOfLines = 0;
    [self.labelOfFooter mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imageOfBig.mas_bottom).offset(10);
        make.leading.equalTo(self.contentView.mas_leading).offset(8);
        make.width.offset(SCREEN_WIDTH - 16);
    }];
    self.labelOfFooter.font = [UIFont systemFontOfSize:14];
    self.labelOfFooter.textColor = [UIColor grayColor];
    
    [self.labelOfFooter release];
    
}


- (void)setModel:(ModelOfTuwen *)model{
    
    
    NSLog(@"%@", model.pic);
    [self.imageOfBig sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:nil];
    
    self.labelOfFooter.text = model.content;
    
}



@end
